package com.ruoyi.contact.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.contact.mapper.ContactReminderMapper;
import com.ruoyi.contact.domain.ContactReminder;
import com.ruoyi.contact.service.IContactReminderService;
import com.ruoyi.common.core.text.Convert;

/**
 * 联系人提醒Service业务层处理
 * 
 * @author useragent-1
 * @date 2025-06-04
 */
@Service
public class ContactReminderServiceImpl implements IContactReminderService 
{
    @Autowired
    private ContactReminderMapper contactReminderMapper;

    /**
     * 查询联系人提醒
     * 
     * @param reminderId 联系人提醒主键
     * @return 联系人提醒
     */
    @Override
    public ContactReminder selectContactReminderByReminderId(Long reminderId)
    {
        return contactReminderMapper.selectContactReminderByReminderId(reminderId);
    }

    /**
     * 查询联系人提醒列表
     * 
     * @param contactReminder 联系人提醒
     * @return 联系人提醒
     */
    @Override
    public List<ContactReminder> selectContactReminderList(ContactReminder contactReminder)
    {
        return contactReminderMapper.selectContactReminderList(contactReminder);
    }

    /**
     * 新增联系人提醒
     * 
     * @param contactReminder 联系人提醒
     * @return 结果
     */
    @Override
    public int insertContactReminder(ContactReminder contactReminder)
    {
        contactReminder.setCreateTime(DateUtils.getNowDate());
        return contactReminderMapper.insertContactReminder(contactReminder);
    }

    /**
     * 修改联系人提醒
     * 
     * @param contactReminder 联系人提醒
     * @return 结果
     */
    @Override
    public int updateContactReminder(ContactReminder contactReminder)
    {
        contactReminder.setUpdateTime(DateUtils.getNowDate());
        return contactReminderMapper.updateContactReminder(contactReminder);
    }

    /**
     * 批量删除联系人提醒
     * 
     * @param reminderIds 需要删除的联系人提醒主键
     * @return 结果
     */
    @Override
    public int deleteContactReminderByReminderIds(String reminderIds)
    {
        return contactReminderMapper.deleteContactReminderByReminderIds(Convert.toStrArray(reminderIds));
    }

    /**
     * 删除联系人提醒信息
     * 
     * @param reminderId 联系人提醒主键
     * @return 结果
     */
    @Override
    public int deleteContactReminderByReminderId(Long reminderId)
    {
        return contactReminderMapper.deleteContactReminderByReminderId(reminderId);
    }
}
